import { createApp } from 'vue'
import { createPinia } from 'pinia'
import 'virtual:svg-icons-register'
import App from './App.vue'
import router from './router'
import systemAuth from './systemAuth'
import SvgIcon from '@/components/SvgIcon/SvgIcon.vue'
import BaseECharts from '@/components/BaseECharts/BaseECharts.vue'
import { setTableConfig } from '@ued_fpi/element-plus-expand'
import './styles/index.scss'

/**
 * fpi表格配置
 */
setTableConfig({
    pageInit: {
        pageSizes: 10,
        currentPage: 1,
        total: 0,
        pageSizesArr: [10, 20, 30, 40, 50, 100],
    },
})

/** 创建app必须提到外层，否则 systemAuth函数将无法使用pinia */
const app = createApp(App)
app.use(createPinia())
app.use(router)
app.component('SvgIcon', SvgIcon)
app.component('BaseECharts', BaseECharts)

systemAuth().then(res => {
    if (res) {
        app.mount('#app')
    }
})
